function chart(total_returns_list, benchmark_return_list) {
    Highcharts.setOptions({
    lang:{
           contextButtonTitle:"图表导出菜单",
           decimalPoint:".",
           downloadJPEG:"下载JPEG图片",
           downloadPDF:"下载PDF文件",
           downloadPNG:"下载PNG文件",
           downloadSVG:"下载SVG文件",
           drillUpText:"返回 {series.name}",
           loading:"加载中",
           months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
           noData:"没有数据",
           numericSymbols: [ "千" , "兆" , "G" , "T" , "P" , "E"],
           printChart:"打印图表",
           resetZoom:"恢复缩放",
           resetZoomTitle:"恢复图表",
           shortMonths: [ "一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
           thousandsSep:",",
           weekdays: ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六","星期天"],
           rangeSelectorZoom:'缩放'
        }
    });

    $('#main').highcharts('StockChart', {
        rangeSelector: {
            selected: 2,
            buttons: [{//定义一组buttons,下标从0开始
                    type: 'week',
                    count: 1,
                    text: '1周'
                },
                {
                    type: 'month',
                    count: 1,
                    text: '1月'
                },
                {
                    type: 'month',
                    count: 3,
                    text: '3月'
                },
                {
                    type: 'month',
                    count: 6,
                    text: '6月'
                },
                {
                    type: 'year',
                    count: 1,
                    text: '1年'
                },
                {
                    type: 'all',
                    text: '全部'
                }]
        },
        credits: {
             enabled:false
        },
         yAxis: {
            minorTickInterval: "auto",
				minorTickLength: 10,
				labels: {
					align: "right",
					format: "{value}%",
					x: -3
				},
				opposite: !0,
				height: "100%",
				lineWidth: 0,
				plotLines: [{
					value: 0,
					width: 1,
					color: "#808080"
				}]

         },
        tooltip: {
             dateTimeLabelFormats: {
					second: "%Y-%m-%d %H:%M:%S",
					minute: "%Y-%m-%d %H:%M",
					hour: "%Y-%m-%d %H:%M",
					day: "%Y-%m-%d",
					week: "%Y-%m-%d",
					month: "%Y-%m",
					year: "%Y"
				},
            pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}%</b><br/>',
            valueDecimals: 2
            },
        xAxis: {
                dateTimeLabelFormats: {
					second: "%Y-%m-%d<br/>%H:%M:%S",
					minute: "%Y-%m-%d<br/>%H:%M",
					hour: "%Y-%m-%d<br/>%H:%M",
					day: "%Y<br/>%m-%d",
					week: "%Y<br/>%m-%d",
					month: "%Y-%m",
					year: "%Y"
				},
            gridLineWidth: 1 ,//纵向网格线宽度
        },
        scrollbar: {
                dateTimeLabelFormats: {
                    second: "%Y-%m-%d %H:%M:%S",
					minute: "%Y-%m-%d %H:%M",
					hour: "%Y-%m-%d %H:%M",
					day: "%Y-%m-%d",
					week: "%Y-%m-%d",
					month: "%Y-%m",
					year: "%Y"
                }
            },
        series: [{
                    name:'基准收益',
                    data:benchmark_return_list,
                    color:"#000080"
                },
                {
                    name:'回测收益',
                    data:total_returns_list,
                    color:"#8B0000"
                }]
    });
}
Math.mul = function(v1, v2)
{
  var m = 0;
  var s1 = v1.toString();
  var s2 = v2.toString();
  try
  {
    m += s1.split(".")[1].length;
  }
  catch (e)
  {
  }
  try
  {
    m += s2.split(".")[1].length;
  }
  catch (e)
  {
  }

  return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
}
{


    $.post("/api/strategyinfo",{
    },
    function(data){
        $(".right_cont .moudle_top .date").text(data.begintime+ " -- "+data.endtime);
        $(".right_cont .moudle_top .time").text(data.runtime+ "秒");
        $(".right_cont .moudle_top .initial").text(data.initcash);
    });

	$.post("/api/returninfo", {
		},
		function(data){
            $(".totalReturn span").text(Math.mul(data["totalReturn"],100).toFixed(2)+"%");
            $(".annualReturn span").text(Math.mul(data["annualreturn"],100).toFixed(2)+"%");
            $(".benchmarkReturn span").text(Math.mul(data["benchmarkReturn"],100).toFixed(2)+"%");
            $(".annaulBenchmarkReturn span").text(Math.mul(data["benchmarkAnnualReturn"],100).toFixed(2)+"%");
            $(".moudle_mid .alpha span").text(data["alpha"]);
            $(".moudle_mid .beta span").text(data["beta"]);
            $(".moudle_mid .sharpe span").text(data["sharpe"]);
            $(".moudle_mid .sortino span").text(data["sortino"]);
            $(".moudle_mid .inforatio span").text(data["inforatio"]);
            $(".moudle_mid .maxDrewdown span").text(data["maxDrewdown"]);
            $(".moudle_mid .trackingerror span").text(data["trackingerror"]);
            $(".moudle_mid .downsiderisk span").text(data["downsiderisk"]);
            $(".moudle_mid .volatility span").text(data["volatility"]);
            chart(data["totalReturnList"], data["benchmarkReturnList"]);

	},"json");
}
